import requests

from APIs.V2.a import LoginAPI
from common.conf import url


class IndexAPI():
    def __init__(self):
        self.token ,self.code=LoginAPI().login()

    def inum(self):
        url1=url.__add__("/OaBackLog/num")
        # 首页统计
        a = requests.post(url1, headers=self.token)
        # print(a.json())

    def oaEvent(self):

        # 工作台任务列表
        a = requests.post("http://192.168.124.121:8080/OaRecord/queryTask",headers=self.token)
        # print(a.json())
        # 工作台当月日
        a = requests.post("http://192.168.124.121:8080/OaRecord/queryEvent", data="month=2023-09", headers=self.token)
        # print(a.json())

        a = requests.post("http://192.168.124.121:8080/OaRecord/queryEventByDay", data="day=2023-09-26", headers=self.token)
        # print(a.json())
    def itask(self):

        z = {"type": "0", "page": "1", "limit": "15"}
        a = requests.post("http://192.168.124.121:8080/OaRecord/getOaRecordPageList", data=z, headers=self.token)
        # print(a.json())

if __name__ == '__main__':

    token=LoginAPI().login()[0]
    IndexAPI().inum()